package demo1;

public class Test {

    public static void test1(Animal animal) {
        animal.eat();
    }

    public static void test2(Dog dog) {
        dog.swim();
    }

    public static void test3(Bird bird) {
        bird.fly();
    }

    public static void test4(IRunning running) {
        running.run();
    }

    public static void test5(ISwimming swimming) {
        swimming.swim();
    }
    public static void test6(IFlying flying) {
        flying.fly();
    }

    public static void main(String[] args) {
       Bird bird1 = new Bird("乌鸦",11);
       Dog dog1 = new Dog("来福",12);

       Robot robot1 = new Robot("九号",2);

       test5(dog1);
       test2(dog1);
        System.out.println("===============");
       test3(bird1);

       test3(bird1);

       test4(robot1);
        test6(bird1);
        test4(new Robot("智能型",2));
//        test1(new Robot("智能型",2));


    }



}
